package Day4231;

/**
 * @author: Li fei
 * @date: 2018-04-23
 * @time: 22:30
 */
public class CheckingAccount extends Account {
    public CheckingAccount() {
    }

    public CheckingAccount(String idCard, double balance) {
        super(idCard, balance);
    }

    @Override
    public double getInterest() {
        double a = 0;
        if (getBalance() >= 0 && getBalance() < 20000) {
            a= getBalance() * 0.0036;
        } else if (getBalance() >= 20000 && getBalance() < 40000){
            a= getBalance() * 0.0037;
        } else if (getBalance() >= 40000 && getBalance() < 80000) {
            a= getBalance() * 0.0038;
        } else  {
            a= getBalance() * 0.0040;
        }
        return a;
    }
}
